﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title></title>
    <link rel="stylesheet" href="/View_Mobile/CSS/msui.css">
    <style>
        .list-group-title {
            color: #777 !important;
            font-size: 0.8rem !important;
        }

        .item-title {
            font-size: 0.7rem !important;
            -webkit-box-flex: 1;
        }

        .ms-controller, [ms-controller] {
            display: none;
        }
    </style>
</head>
<body ms-controller="APP_MOBILE_APPLIST">
    <div class="page page-current " id="pageindex1">
        <header class="bar bar-nav">
            <a class="button button-link button-nav pull-left back">
                <span class="icon icon-left"></span>
                返回
            </a>
            <h1 class="title" >应用列表设置</h1>
        </header>
        <div class="content native-scroll">
            <div class="list-block contacts-block" style="margin:0px;">
                <div class="list-group">
                    <ul ms-repeat-item="TJModel">
                        <li class="list-group-title">{{item.ModelType}}</li>
                        <li ms-repeat-el="item.Model" >
                            <div class="item-content">
                                <div class="item-media"><img class="icon" style="width: 1.45rem;height: 1.45rem;" ms-attr-src="/View_Mobile/Images/icon/{{el.ModelCode}}.png" onerror="javascript: this.src = '/View_Mobile/Images/icon/Common.png'" /></div>
                                <div class="item-inner">
                                    <div class="item-title">{{el.ModelName}}</div>
                                    <div>
                                        <label class="label-switch">
                                            <input type="checkbox" class="ckmodel" ms-attr-checked="el.UserAPPID>0&&el.DataContent1=='Y'" ms-attr-modecode="el.ModelCode">
                                            <div class="checkbox" ms-click="setData(el,this,$event)"></div>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <link href="/View_Mobile/JS/layer/need/layer.css" rel="stylesheet" />
    <script src="/View_Mobile/JS/layer/layer.m.js"></script>
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script>$.config = { autoInit: true }</script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.8/js/sm.min.js' charset='utf-8'></script>
    <script src="/View_Mobile/JS/ComFunJS.js?jsver=20160425"></script>
    <script src="/ViewV5/JS/avalon1.5.js"></script>
    <script type="text/javascript">
        var model = avalon.define({
            $id: "APP_MOBILE_APPLIST",
            TJModel: [],
            UserData: [],
            setData: function (el, dom, event) { 
                event.stopPropagation(); 
                $.getJSON('/API/VIEWAPI.ashx?Action=INIT_SETAPPINDEX', { "P1": el.ModelCode+":"+($(dom).parent().find("input[type=checkbox]").attr("checked") ? "N" : "Y"), type: "APPINDEX" }, function (result) {
                    if (result.ErrorMsg == "") {
                        el.UserAPPID = result.Result.ID;
                        el.DataContent1 = result.Result.DataContent1; 
                        $.toast('操作成功', 1000, 'success top');
                    }
                })
            }, 
            GetAPPList: function () {
                $.getJSON('/API/VIEWAPI.ashx?Action=INIT_GETMOBILETJDATA', { P1: "APPINDEX" }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.TJModel = resultData.Result;
                    }
                })
            }
        })
        avalon.ready(function () {
            model.GetAPPList()
        })//# sourceURL=APPLIST.js;
    </script>
</body>
</html>
